<template>
  <el-form>
    <h2>布局设置</h2>
    <el-form-item label="导航条类型">
      <el-radio-group v-model="navbarLayoutType">
        <el-radio label="default" border>default</el-radio>
        <el-radio label="inverse" border>inverse</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="导航条皮肤">
      <el-radio-group v-model="navbarLayoutSkin">
        <el-radio label="default" border>default</el-radio>
        <el-radio label="red" border>red</el-radio>
        <el-radio label="deepblue" border>deepblue</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="侧边栏类型">
      <el-radio-group v-model="updateSidebarType">
        <el-radio label="default" border>default</el-radio>
        <el-radio label="darkBlue" border>darkBlue</el-radio>
        <el-radio label="darkTheme" border>darkTheme</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="侧边栏皮肤">
      <el-radio-group v-model="sidebarLayoutSkin">
        <el-radio label="light" border>light</el-radio>
        <el-radio label="dark" border>dark</el-radio>
      </el-radio-group>
    </el-form-item>
  </el-form>
</template>

<script>
  export default {
    computed: {
      userName: {
        get () { return this.$store.state.user.name }
      },
      userId: {
        get () { return this.$store.state.user.id }
      },
      navbarLayoutType: {
        get () { return this.$store.state.common.navbarLayoutType },
        set (val) {
          /* console.log(this.userName)
          console.log(this.$store.state.user.name)
          console.log(this.$store.state.user.id) */
          this.$store.commit('common/updateNavbarLayoutType', val)
        }
      },
      navbarLayoutSkin: {
        get () { return this.$store.state.common.navbarSkin },
        set (val) { this.$store.commit('common/updateNavbarSkin', val) }
      },
      sidebarLayoutSkin: {
        get () { return this.$store.state.common.sidebarLayoutSkin },
        set (val) { this.$store.commit('common/updateSidebarLayoutSkin', val) }
      },
      updateSidebarType: {
        get () { return this.$store.state.common.sidebarType },
        set (val) { this.$store.commit('common/updateSidebarType', val) }
      }
    }
  }
</script>

